package com.cloud.help.service.serviceImpl;

import com.cloud.commonapi.model.Help_info;
import com.cloud.help.dao.Help_infoMapper;
import com.cloud.help.entity.Account_HelpInfo;
import com.cloud.help.service.HelpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author : 黄永佳
 * create : 2019/9/29 0029 8:58
 * modified :
 * 功能 :
 **/
@Service
public class HelpServiceImpl implements HelpService {
    @Autowired
    Help_infoMapper help_infoMapper;
    @Override
    public int addHelp(Help_info help_info) {
        return help_infoMapper.insertSelective(help_info);
    }

    @Override
    public int delete(int id) {
        return help_infoMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Account_HelpInfo selectById(int id) {
        return help_infoMapper.selectById(id);
    }

    @Override
    public int update(Help_info help_info) {
        return help_infoMapper.updateByPrimaryKeySelective(help_info);
    }

    @Override
    public List<Account_HelpInfo> findAll() {
        return help_infoMapper.findAll();
    }

    @Override
    public List<Account_HelpInfo> findByKeyword(String keyword) {
        return help_infoMapper.selectBykeyword(keyword);
    }

    @Override
    public List<Account_HelpInfo> findByAccountId(int accountId) {
        return help_infoMapper.selectByAccountId(accountId);
    }
}
